import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/emergency/emergency_assess_entity.dart';

EmergencyAssessEntity $EmergencyAssessEntityFromJson(Map<String, dynamic> json) {
  final EmergencyAssessEntity emergencyAssessEntity = EmergencyAssessEntity();
  final String? assessmentReport = jsonConvert.convert<String>(json['assessmentReport']);
  if (assessmentReport != null) {
    emergencyAssessEntity.assessmentReport = assessmentReport;
  }
  final String? assessors = jsonConvert.convert<String>(json['assessors']);
  if (assessors != null) {
    emergencyAssessEntity.assessors = assessors;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    emergencyAssessEntity.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    emergencyAssessEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    emergencyAssessEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    emergencyAssessEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    emergencyAssessEntity.deleted = deleted;
  }
  final String? emergencyExpertId = jsonConvert.convert<String>(json['emergencyExpertId']);
  if (emergencyExpertId != null) {
    emergencyAssessEntity.emergencyExpertId = emergencyExpertId;
  }
  final String? evaluationResults = jsonConvert.convert<String>(json['evaluationResults']);
  if (evaluationResults != null) {
    emergencyAssessEntity.evaluationResults = evaluationResults;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    emergencyAssessEntity.id = id;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    emergencyAssessEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    emergencyAssessEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    emergencyAssessEntity.updateDate = updateDate;
  }
  return emergencyAssessEntity;
}

Map<String, dynamic> $EmergencyAssessEntityToJson(EmergencyAssessEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['assessmentReport'] = entity.assessmentReport;
  data['assessors'] = entity.assessors;
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['emergencyExpertId'] = entity.emergencyExpertId;
  data['evaluationResults'] = entity.evaluationResults;
  data['id'] = entity.id;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  return data;
}

extension EmergencyAssessEntityExtension on EmergencyAssessEntity {
  EmergencyAssessEntity copyWith({
    String? assessmentReport,
    String? assessors,
    String? companyCode,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    String? emergencyExpertId,
    String? evaluationResults,
    String? id,
    String? updateBy,
    String? updateById,
    String? updateDate,
  }) {
    return EmergencyAssessEntity()
      ..assessmentReport = assessmentReport ?? this.assessmentReport
      ..assessors = assessors ?? this.assessors
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..emergencyExpertId = emergencyExpertId ?? this.emergencyExpertId
      ..evaluationResults = evaluationResults ?? this.evaluationResults
      ..id = id ?? this.id
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate;
  }
}
